how to add an active class to current element in navbar in django

47

how to add an active class to current element in navbar in django -

<li {% if request.resolver_match.url_name == 'home' %}class="active"{% endif %}>
    <a href="/">HOME</a>
</li>

Comments

Submit
0 Comments